<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,user-scalable=no">
    <!-- Link Swiper's CSS -->
    <link rel="stylesheet" href="css/public.css">
    <link rel="stylesheet" href="css/gameStart.css">
    <script src="js/jquery.1.7.2.min.js"></script>
    <script src="js/load.js"></script>
    <script src="js/swiper.min.js"></script>
    <title></title>
</head>
<body>
<div class="bg_wrap bg_gameStart">
  <div class="car pos_a left50"></div>
  <a href="javascript:;" class="startGo pos_a left50"></a>
</div>
</body>
<script>
    loadPage({
        "img":[
            "images/bg_game.png",
            "images/bg_gameOver.png",
            "images/bg_list.png",
            "images/bg_Ranking.png",
            "images/bg_statGame.png",
            "images/button_Charge.png",
            "images/button_iKnow.png",
            "images/button_NoCharge.png",
            "images/button_wrap.png",
            "images/icon_1.png",
            "images/icon_close.png",
            "images/icon_edge.png",
            "images/icon_flag.png",
            "images/icon_left.png",
            "images/icon_number1.png",
            "images/icon_number2.png",
            "images/icon_number3.png",
            "images/icon_ranking.png",
            "images/icon_right.png",
            "images/icon_startGame.png",
            "images/image_car.png",
            "images/img_car.png",
            "images/img_Energy.png",
            "images/img_lsit1.png",
            "images/img_lsit2.png",
            "images/img_lsit3.png",
            "images/img_NoEnergy.png",
            "images/img_shareMain.png",
            "images/img_show.png",
            "images/img_swiper.png",
            "images/list_content1.png",
            "images/list_content2.png",
            "images/list_content3.png",
            "images/list_wrap.png",
            "images/title_rule1.png",
            "images/word_AYR.png",
            "images/word_backIndex.png",
            "images/word_gameRule.png",
            "images/word_iKnow.png",
            "images/word_newActivity.png",
            "images/word_newActivity_Plus.png",
            "images/word_ranking.png",
            "images/word_restart.png",
            "images/word_share.png",
            "images/word_submit.png",
            "images/wrap_img.png"
        ],
        "audio":[
          "http://www.w3school.com.cn/i/song.mp3"
        ]
      },function(count2,count){
        if(count2/count){
            $(".car").addClass("on")
        }
      })




      function loadPage(state,fn){
        var count=0;
        var count2=0;

        if(state.img) var images=state.img;
        count+=images.length;
        for(var i=0;i<images.length;i++){
          loadImage(state.img[i])
        }

        if(state.img) var audio=state.audio;
        count+=audio.length;
        for(var i=0;i<audio.length;i++){
          loadAudio(state.audio[i])
        }

        var timer=setInterval(function(){
          fn(count2,count);
          if(count==count2){
            clearInterval(timer);
          }
        },30)


        function loadAudio(src){
          var aud=new Audio();
          aud.src=src;
          aud.addEventListener('canplay', function() {
            count2++;
          }, false);
        }
        function loadImage(src){
          var img=new Image();
          img.src=src;
          img.onload=function(){
            count2++;
          }
        }
      }
</script>
<script src="js/public.js"></script>
<script src="js/style.js"></script>
<script src="js/effect.js"></script>
</html>
